<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/10/11
 * Time: 9:28
 * @copyright   A copyright
 * @license
 */

//$ch = curl_init("http://baike.baidu.com/api/openapi/BaikeLemmaCardApi?scope=103&format=json&appid=379020&bk_key=%E9%93%B6%E9%AD%82&bk_length=600") ;
$ch = curl_init("http://wp4.6.dev/?json=get_post&post_id=5") ;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ; // 获取数据返回
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ; // 在启用 CURLOPT_RETURNTRANSFER 时候将获取数据返回
echo $output = curl_exec($ch) ;

///* 写入文件 */
$fh = fopen("out.html", 'w') ;
fwrite($fh, $output) ;
fclose($fh) ;


